var app = {
	init: function() {
		app.footerSuperiority();
		app.navbar();
		$("#main-right").height($("#main").height());
	},
	navbar:function(){
		$("#nav li").on("click",function(){
			var self=$(this);
			self.addClass('current').siblings().removeClass('current');
		});
	},
	footerSuperiority: function() {
		$(".foot-icons li").mouseenter(function() {
			var self = $(this);
			$(".foot-icon-content-inner").html(self.find(".foot-icon-con").html());
			if (self.index() == 0) {
				$(".foot-icon-content").css({
					"left": "0",
					"margin-left": "0"

				});
				$(".foot-icon-content-arrow").css({
					"left": "38px"
				});

			} else if (self.index() == 5) {

				$(".foot-icon-content").css({
					"left": self.position().left,
					"margin-left": "-126px"

				});
				$(".foot-icon-content-arrow").css({
					"left": "240px"
				});
			} else {

				$(".foot-icon-content").css({
					"left": self.position().left - 28,
					"margin-left": "0"

				});
				$(".foot-icon-content-arrow").css({
					"left": "50%"
				});
			};


			$(".foot-icon-content").show();
		});
		$(".foot-icons").mouseleave(function() {
			$(".foot-icon-content").hide();
		});
	},
	resizeImg:function(pic){
		var rimg="";
		if(pic==""|| pic==null){
			rimg=$(".resize-img img");
		}else{
			rimg=$(pic);
		}
		rimg.each(function(){

			var obj=$(this);
			if (obj.height()<obj.parent().height()) {					
				obj.css({
					"width":"auto",
					"height":obj.parent().height()
				});
			}else{
				obj.css({
					"width":"100%",
					"height":"auto"
				});
			};
			
			// obj.fadeIn();
		});
	}
};

(function($){
	$(function() {
		app.init();
	});
})(jQuery);